package view.base;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;

import base.ScreenActionListener;

public class FormScreen extends Form implements CommandListener {
	
	protected final ScreenActionListener controller;
	
	public FormScreen(ScreenActionListener controller, String title){
		super(title);
		this.controller = controller;
		
		this.addCommand(new Command("Back", Command.BACK, 0));
	}

	public void commandAction(Command c, Displayable d) {
		switch (c.getCommandType()) {
		case Command.BACK:
			controller.viewAction(Command.BACK, null);
			break;
		}
		
	}

}
